<?php

namespace app\company\validate;

use think\facade\Validate;

class LocationValidate extends Validate
{
    protected $rule = [
            'name'         => 'require|max:20|unique:dealer',
            'warehouse_id' => 'require',
            'area_id'      => 'require',
            'column_num'   => 'require',
            'floor_num'    => 'require',
    ];

    protected $message = [
            'name.require'         => '库位编号名称不能为空',
            'name.max'             => '库位名称不能超过20个字符',
            'name.unique'          => '库位名称已存在',
            'warehouse_id.require' => '库位ID不能为空',
            'area_id.require'      => '库区ID不能为空',
            'column_num.require'   => '列数不能为空',
            'floor_num.require'    => '层数不能为空',
    ];
    protected $scene   = [
            'add' => ['name', 'warehouse_id', 'area_id', 'column_num', 'floor_num'],
    ];

}